package com.trsjh.db.domains;
// Generated 2012-1-13 13:41:53 by Hibernate Tools 3.4.0.CR1


import java.math.BigDecimal;
import java.util.HashSet;
import java.util.Set;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import static javax.persistence.GenerationType.IDENTITY;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;

/**
 * GlassOrder generated by hbm2java
 */
@Entity
@Table(name="glassOrders"
,catalog="myglass"
		)
public class GlassOrder  implements java.io.Serializable {


	/**
	 * 
	 */
	private static final long serialVersionUID = -477399423070171375L;

	@Id @GeneratedValue(strategy=IDENTITY)
	@Column(name="id", unique=true, nullable=false)
	private Integer id;

	@ManyToOne(fetch=FetchType.LAZY)
	@JoinColumn(name="leftGlass")
	private GoodPrice leftGlass;

	@ManyToOne(fetch=FetchType.LAZY)
	@JoinColumn(name="rightGlass")
	private GoodPrice rightGlass;

	@ManyToOne(fetch=FetchType.LAZY)
	@JoinColumn(name="mainOrder", nullable=false)
	private Order order;

	@ManyToOne(fetch=FetchType.LAZY)
	@JoinColumn(name="optometrist")
	private User optometrist;

	@ManyToOne(fetch=FetchType.LAZY)
	@JoinColumn(name="saller")
	private User saller;

	@ManyToOne(fetch=FetchType.LAZY)
	@JoinColumn(name="glass")
	private GoodPrice midGlass;
	@ManyToOne(fetch=FetchType.LAZY)
	@JoinColumn(name="worker")
	private User worker;

	@Column(name="number", nullable=false)
	private int number;

	@Column(name="realmoney", precision=9)
	private BigDecimal realmoney;

	@Column(name="discount", precision=9)
	private BigDecimal discount;

	@Column(name="leftSight", precision=12, scale=0)
	private Float leftSight;

	@Column(name="rightSight", precision=12, scale=0)
	private Float rightSight;

	@Column(name="leftSight2", precision=12, scale=0)
	private Float leftSight2;

	@Column(name="rightSight2", precision=12, scale=0)
	private Float rightSight2;

	@Column(name="distance", precision=12, scale=0)
	private Float distance;

	@OneToMany(fetch=FetchType.LAZY, mappedBy="solution")
	private Set<CustomerRecord> customerRecords = new HashSet<CustomerRecord>(0);

	public GlassOrder() {
	}


	public GlassOrder(Order orders, int number) {
		this.order = orders;
		this.number = number;
	}
	public GlassOrder(GoodPrice goodPricesByLeftGlass, GoodPrice goodPricesByRightGlass, Order orders, User usersByOptometrist, User usersBySaller, GoodPrice goodPricesByGlass, User usersByWorker, int number, BigDecimal realmoney, BigDecimal discount, Float leftSight, Float rightSight, Float leftSight2, Float rightSight2, Float distance, Set<CustomerRecord> customerRecordses) {
		this.leftGlass = goodPricesByLeftGlass;
		this.rightGlass = goodPricesByRightGlass;
		this.order = orders;
		this.optometrist = usersByOptometrist;
		this.saller = usersBySaller;
		this.midGlass = goodPricesByGlass;
		this.worker = usersByWorker;
		this.number = number;
		this.realmoney = realmoney;
		this.discount = discount;
		this.leftSight = leftSight;
		this.rightSight = rightSight;
		this.leftSight2 = leftSight2;
		this.rightSight2 = rightSight2;
		this.distance = distance;
		this.customerRecords = customerRecordses;
	}

	public Integer getId() {
		return this.id;
	}

	public void setId(Integer id) {
		this.id = id;
	}


	public int getNumber() {
		return this.number;
	}

	public void setNumber(int number) {
		this.number = number;
	}

	public BigDecimal getRealmoney() {
		return this.realmoney;
	}

	public void setRealmoney(BigDecimal realmoney) {
		this.realmoney = realmoney;
	}

	public BigDecimal getDiscount() {
		return this.discount;
	}

	public void setDiscount(BigDecimal discount) {
		this.discount = discount;
	}

	public Float getLeftSight() {
		return this.leftSight;
	}

	public void setLeftSight(Float leftSight) {
		this.leftSight = leftSight;
	}

	public Float getRightSight() {
		return this.rightSight;
	}

	public void setRightSight(Float rightSight) {
		this.rightSight = rightSight;
	}

	public Float getLeftSight2() {
		return this.leftSight2;
	}

	public void setLeftSight2(Float leftSight2) {
		this.leftSight2 = leftSight2;
	}

	public Float getRightSight2() {
		return this.rightSight2;
	}

	public void setRightSight2(Float rightSight2) {
		this.rightSight2 = rightSight2;
	}

	public Float getDistance() {
		return this.distance;
	}

	public void setDistance(Float distance) {
		this.distance = distance;
	}


	public GoodPrice getLeftGlass() {
		return leftGlass;
	}


	public void setLeftGlass(GoodPrice leftGlass) {
		this.leftGlass = leftGlass;
	}


	public GoodPrice getRightGlass() {
		return rightGlass;
	}


	public void setRightGlass(GoodPrice rightGlass) {
		this.rightGlass = rightGlass;
	}


	public Order getOrder() {
		return order;
	}


	public void setOrder(Order order) {
		this.order = order;
	}


	public User getOptometrist() {
		return optometrist;
	}


	public void setOptometrist(User optometrist) {
		this.optometrist = optometrist;
	}


	public User getSaller() {
		return saller;
	}


	public void setSaller(User saller) {
		this.saller = saller;
	}


	public GoodPrice getMidGlass() {
		return midGlass;
	}


	public void setMidGlass(GoodPrice midGlass) {
		this.midGlass = midGlass;
	}


	public User getWorker() {
		return worker;
	}


	public void setWorker(User worker) {
		this.worker = worker;
	}


	public Set<CustomerRecord> getCustomerRecords() {
		return customerRecords;
	}


	public void setCustomerRecords(Set<CustomerRecord> customerRecords) {
		this.customerRecords = customerRecords;
	}
	




}


